home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / 4dos / arconv01.zip / A2.DAT < prev    next >
Text File  |  1993-06-29  |  4KB  |  165 lines

  1. set DEFAULT=arj
  2. set ARCINDEX=1
  3. unset /q ALLFILES
  4.  
  5. if "%1" == "" goto syntax
  6.  
  7. if "%1" == "arj" goto arj
  8. if "%1" == "zip" goto zip
  9. if "%1" == "lzh" goto lha
  10. if "%1" == "zoo" goto zoo
  11. if "%1" == "arc" goto arc
  12. if "%1" == "hpk" goto hpack
  13. if "%1" == "sqz" goto squeeze
  14. if "%1" == "ash" goto ash
  15. if "%1" == "ha"  goto ha
  16. if "%1" == "hap" goto hap
  17. if "%1" == "z"   goto gzip
  18. if "%1" == "hyp" goto hyper
  19. goto %DEFAULT
  20.  
  21. :arj
  22. iff "%1" == "arj" then shift ^ endiff
  23. %BASEDIR\arj a -jm %&
  24. goto finish
  25.  
  26. :zip
  27. iff "%1" == "zip" then shift ^ endiff
  28. iff "%1" == "-r" then
  29.   %BASEDIR\pkzip -rp -ex %&
  30. else
  31.   %BASEDIR\pkzip -ex %&
  32. endiff
  33. goto finish
  34.  
  35. :lha
  36. iff "%1" == "lzh" then shift ^ endiff
  37. %BASEDIR\lha a %&
  38. goto finish
  39.  
  40. :hpack
  41. iff "%1" == "hpk" then shift ^ endiff
  42. %BASEDIR\hpack a -d %&
  43. goto finish
  44.  
  45. :squeeze
  46. iff "%1" == "sqz" then shift ^ endiff
  47. iff "%1" == "-r" then shift ^ set SUB=-s
  48. endiff
  49. gosub getfiles
  50. %BASEDIR\sqz a -z03 %SUB %& %ALLFILES
  51. goto finish
  52.  
  53. :zoo
  54. iff "%1" == "zoo" then shift ^ endiff
  55. iff "%1" == "-r" then shift ^ endiff
  56. :: Unfortonately, I do not know how to handle recursion with zoo
  57. gosub getfiles
  58. %BASEDIR\zoo ah %& %ALLFILES
  59. goto finish
  60.  
  61. :arc
  62. iff "%1" == "arc" then shift ^ endiff
  63. iff "%1" == "-r"  then shift ^ endiff
  64. :: Unfortonately, I do not know how to handle recursion with arc too.
  65. gosub getfiles
  66. %BASEDIR\pkpak a %& %ALLFILES
  67. goto finish
  68.  
  69. :ash
  70. iff "%1" == "ash" then shift ^ endiff
  71. iff "%1" == "-r"  then shift ^ endiff
  72. %BASEDIR\ash 3 %1 %@NAME[%1].ash
  73. goto finish
  74.  
  75. :ha
  76. iff "%1" == "ha" then shift ^ endiff
  77. iff "%1" == "-r" then
  78.   shift
  79.   %BASEDIR\ha ar %&
  80. else
  81.   %BASEDIR\ha a %&
  82. endiff
  83. goto finish
  84.  
  85. :hap
  86. iff "%1" == "hap" then shift ^ endiff
  87. iff "%1" == "-r" then shift ^ endiff
  88. gosub getfiles
  89. %BASEDIR\hap3 a %& %ALLFILES
  90. goto finish
  91.  
  92. :gzip
  93. iff "%1" == "z"  then shift ^ endiff
  94. iff "%r" == "-r" then shift ^ endiff
  95. %BASEDIR\gzip %&
  96. goto finish
  97.  
  98. :hyper
  99. iff "%1" == "hyp" then shift ^ endiff
  100. iff "%1" == "-r" then
  101.   %BASEDIR\hyper -a -p %&
  102. else
  103.   %BASEDIR\hyper -a %&
  104. endiff
  105. goto finish
  106.  
  107.  
  108. ::------Procedures:
  109.  
  110. :: This procedure tries to guess and find the filename argument, i.e,
  111. :: It puts ARCINDEX to point to the first arg not starting in "-" or "/".
  112.  
  113. :findindex
  114. if "%@SUBSTR[%[%ARCINDEX], 0, 1]" != "-" .and. "%@SUBSTR[%[%ARCINDEX], 0, 1]" != "/" goto findend
  115. set ARCINDEX=%@EVAL[%ARCINDEX + 1]
  116. goto findindex
  117. :findend
  118. return
  119.  
  120. ::This procedures uses findindex to try to find out whether filenames to
  121. :: archive were given. If not, the variable ALLFILES is set to *.*, otherwise
  122. :: it is null. Thus, if you call your archiver with this var as last arg, after
  123. :: calling this procedure, it'll default to all files when no filenames archive
  124. :: are supplied by the user. This is comfortobale, and required by TO.BTM
  125.  
  126. :getfiles
  127. gosub findindex
  128. iff "%[%@EVAL[%ARCINDEX + 1]]" == "" then set ALLFILES=*.*
  129. endiff
  130. return
  131.  
  132.  
  133. :syntax
  134. echos Syntax: %0 [
  135. color bright green on black
  136. echos arc
  137. color white on black
  138. echos ] [
  139. color bright blue on black
  140. echos -r
  141. color white on black
  142. echos ]
  143. color bright yellow on black
  144. echo  arguments...
  145. color white on black
  146. echos Where
  147. color bright green on black
  148. echos  arc
  149. color white on black
  150. echo  is one of the following: arj zip lzh zoo arc hpk sqz ha hap ash z hyp
  151. echo Default for arc is %DEFAULT.
  152. color bright blue on black
  153. echos -r
  154. color white on black
  155. echo  Stands for recurse into sub-dirs (Irrelevant for .Z, .ARC, .ASH)
  156. color bright yellow on black
  157. echos arguments
  158. color white on black
  159. echo  are the arguments for the archiver (including the archive's name),
  160. echo except for the adding cmd, which is added automatically by this file.
  161.  
  162. :finish
  163. endlocal
  164. quit
  165.